<%@ page language="java" pageEncoding="utf-8"
         contentType="text/html;charset=utf-8" %>
<html>

<%@ include file="../../common/jstl.jsp" %>

<head>
</head>

<body>
<div id="addForm" class="mgt40">
    <form action="${ctx }/message/sendMessage" id="message" method="post">
        <input type="hidden" name="str" value="${str}"/>
        <div class="">
            <div class="J_formTable l_form_table">
                <table class="not_hightlight">
                    <tr>
                        <td class="l_title w200"><b class="cRed">*</b> 通知标题</td>
                        <td>
                            <div class="J_toolsBar fl">
                                <div class="t_text w200 ml10">
                                    <input type="text" name="title"
                                           maxlength="20"/>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="l_title "><b class="cRed">*</b> 通知内容</td>
                        <td>
                            <div class="J_toolsBar fl">
                                <div class="t_text w200 ml10">
                                    <label>
                                        <input type="text" name="content"   maxlength="300"/>
                                    </label>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="l_title "><b class="cRed">*</b> 发送方式</td>
                        <td>
                            <div class="J_toolsBar fl">
                                <div class="t_check w200 ml10">
                                    <label>
                                        <input type="radio" name="state" value="1"/>短信发送
                                    </label>
                                    <label>
                                        <input type="radio" name="state" value="0" checked="checked"/>站内信发送
                                    </label>
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript">

    var parentChosen;
    //表单验证
    $(function () {
        $('#message').validator({
            ignore: ':hidden',
            fields: {
            },
            valid: function (form) {
                var laodIdx = layer.load();
                $('#message').ajaxSubmit({
                    data: {
                    },
                    traditional: true,
                    success: function (result) {
                        layer.close(laodIdx);
                        if (result.success) {
                            layer.alert('发送成功', function () {
                                window.location.reload();
                            });
                        } else {
                            layer.alert(result.msg);
                        }
                    }
                });
            }
        });
        /*$('input[name="type"]').on('click', function(){
            var val = $('input[name="type"]:checked').val();
            if(val == 'page'){
                $('#parentMenuSelect').show();
            }else{
                $('#parentMenuSelect').hide();
            }
        });*/

    });


</script>
</body>
</html>